<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">app</div>

  <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js" crossorigin></script>

  <script type="text/babel">
    function getSizeImage(imgUrl, size) {
      console.log(imgUrl + `param=${size}×${size}`)
      return imgUrl + `?param=${size}×${size}`
    }
    
    class App extends React.Component {
      constructor(props) {
        super(props)

        this.state = {
          title: '标题',
          src: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1806353689,2266012200&fm=26&gp=0.jpg',
          alt: 'Nvidia',
          active: true
        }
      }

      render() {
        const { title, src, alt, active } = this.state

        return (
          <div>
            <h2 title={ title }>Title</h2>
            <img src={ getSizeImage(src, 200) } alt={ alt } title={ alt } />

            <div className="div">div element class</div>
            <div className={'div ' + (active ? 'active' : '')}>div element class</div>
 
            <div style={{color: 'red'}}>div element style</div>
          </div>
        )
      }
    }

    ReactDOM.render(<App />, document.getElementById('app'))
  </script>
</body>
</html>